package com.mxpio.erp.common.technology.entity;

import com.mxpio.erp.common.jpa.model.Order;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_TECHNOLOGY_BOM")
@ApiModel(value="Bom")
public class BomInfo extends Order{

	private static final long serialVersionUID = 1L;


	@Column(name = "USE_STATUS_")
	@ApiModelProperty(value = "使用状态")
	@Dict(dicCode = "USE_STATUS")
	private String useStatus;

	@Column(name = "PARENT_CODE_")
	@ApiModelProperty(value = "父项物料编号")
	private String parentCode;

	@Column(name = "PARENT_NAME_")
	@ApiModelProperty(value = "父项物料名称")
	private String parentName;

	@Column(name = "PARENT_SPEC_")
	@ApiModelProperty(value = "父项物料型号")
	private String parentSpec;

	@Column(name = "ITEM_ATTRIBUTE_")
	@ApiModelProperty(value = "物料属性")
	@Dict(dicCode = "ERP_TECH_ITEM_ATTRIBUTE")
	private String itemAttribute;


	@Column(name = "BASIC_CONSUMPTION_")
	@ApiModelProperty(value = "基础用量")
	private String basicConsumption;

	@Column(name = "USER_ORG_")
	@ApiModelProperty(value = "使用组织")
	private String userOrg;

	@Column(name = "VERSION_")
	@ApiModelProperty(value = "BOM版本")
	private String version;

	@Transient
	private List<BomInfoLine> bomInfoLineList;

	@Override
	public String initTypeCode() {
		return "BM1";
	}

}
